home *** CD-ROM | disk | FTP | other *** search
/ Ahoy 1988 February / Ahoy_Magazine_88-02_1988_Double_L.d64 / Screen Wizardry (.txt) < prev    next >
Commodore BASIC  |  2022-10-26  |  4KB  |  114 lines

  1. 10 rem downward vertical scrolling
  2. 20 printchr$(8)chr$(142)
  3. 30 poke53281,.:poke53280,.:print"[147]score 0000  alien hellspawn   ships [218][218][218]"
  4. 40 poke646,rnd(1)*16:print"";tab(rnd(1)*40);chr$(46+(rnd(.)>.9)*-163)
  5. 50 poke218,peek(218)or128
  6. 60 print"[157]";chr$(148)
  7. 70 geta$:ifa$=""then40
  8. 80 rem scrolling color bars
  9. 90 b$="":forx=.to39:b$=b$+chr$(32):next
  10. 100 print"[147]"tab(11)"color bar scrolling"
  11. 110 print""tab(14)"[164][175][162][185][162][184][184][146][162][184][146][185][175][185][164]"
  12. 120 printtab(10)"[164][185][162][183]             [183][184][184][146][185][164]"
  13. 130 printtab(6)"[164][175][162][183]                      [183][146][162][164]"
  14. 140 printtab(5)"[169]                             [223]"
  15. 150 printtab(4)"[169]                              [170]"
  16. 160 printtab(4)"[165]                               "
  17. 170 printtab(4)"                               [146][169]"
  18. 180 printtab(4)"[223]                          [175][162][146][183]"
  19. 190 printtab(5)"[163][183][184][162][146][184][162][146][184][162][185][164]         [164][162][146][183][184][183]"
  20. 200 printtab(16)"[223]      [146][169]"
  21. 210 printtab(17)"      [146][181]"
  22. 220 print" [176][176][176][176][146]"spc(12)"      [146][161]    [172][172][172][146]      [176][176]"
  23. 230 print" [176][176][176][176][146] [187][187][187][146] :::[146]   [161]      [146][165]    [172][172][172][146] [176][176][176][176][146] [176][176]"
  24. 240 print" [176][176][176][176][146] [187][187][187][146] :::[146]   [170]      [146][161] [176][176][146] [172][172][172][146] [176][176][176][176][146] [176][176]"
  25. 250 print" [176][176][176][176][146] [187][187][187][146] :::[146]          [146][165] [176][176][146] [172][172][172][146] [176][176][176][176][146] [176][176]"
  26. 260 print"[162][176][176][176][176][146][162][187][187][187][146][162]:::[146][185][162][164][169]      {$7f}[146][164][176][176][184][172][172][172][146][185][176][176][176][176][163][176][176][146][185]";
  27. 270 print" future's so bright i gotta wear shades "
  28. 280 printtab(11)"press space to exit":poke198,.
  29. 290 rem point screen editor to harmless
  30. 300 rem ram location (192*256=49152)
  31. 310 poke648,192:print
  32. 320 printmid$("[150][129][158]",(rnd(1)*5)+1,1):printb$
  33. 330 geta$:ifa$<>" "then320
  34. 340 poke648,4:print
  35. 350 rem move screen lines
  36. 360 print"[147]"tab(10)"moving screen lines"
  37. 370 forx=.to20:poke646,rnd(1)*15+1:forj=.to4:printspc(3)""x;:nextj:print:nextx
  38. 380 printspc(6)"[146]press m to move line,x to exit"
  39. 390 geta$:ifa$<>"m"then430
  40. 400 ifa$="m"thent=(rnd(1)*21)+1:f=(rnd(1)*21)+1
  41. 410 poke781,t:sys59888:poke172,peek(60656+f):poke780,peek(216+f)
  42. 420 poke783,.:sys59848:print""
  43. 430 ifa$<>"x"then390
  44. 440 poke53248+21,1:poke2040,13:poke53248,170:poke53249,180:poke53248+16,.
  45. 450 poke53248+39,1
  46. 460 print"[147]type in any character :";
  47. 470 geta$:ifa$=""ora$<"a"ora$>"z"then470
  48. 480 printa$
  49. 490 print"i'm creating a string 63 characters longto use as a sprite shape."
  50. 500 s$="":forx=.to63:s$=s$+a$:next:print"s$="chr$(34)s$chr$(34):print
  51. 510 print"now we print this string to the sprite's";
  52. 520 print"block at 828,sprite block 13":print
  53. 530 print"poke648,3:printchr$(19)chr$(17)spc(20);s$:poke648,4":print
  54. 540 print"press key for another character,ctrl-x  to exit shape demo"
  55. 550 gosub580
  56. 560 poke198,.:wait198,1:geta$:ifa$=""thenpoke53248+21,.:goto600
  57. 570 goto460
  58. 580 poke648,3:printchr$(19)chr$(17)spc(20);s$:poke648,4:return
  59. 590 rem horizontal rough scrolling
  60. 600 print"[147]"tab(5)"simple horizontal scrolling"
  61. 610 printtab(6)"cursor keys left <-> right"
  62. 620 printtab(7)"x to exit scrolling demo"
  63. 630 poke214,21:print:printtab(15)"stand by!":forx=.to39:print"[184]";:next:print"[151]";
  64. 640 rem scroll data in four strings
  65. 650 dim l$(39),m$(39,3),s$(3)
  66. 660 s$(.)="            [176][174]          [176][174]           [176][174] "
  67. 670 s$(1)="  [176][178][174]   [213][201]  [171][179]       [176][174] [171][179]     [176][174]    [171][179] "
  68. 680 s$(2)="  [171][219][179]   [171][179]  [171][179]   [213][201]  [171][179] [171][179][176][174]  [176][189][194][176][174]  [171][179] "
  69. 690 s$(3)="[176][174][171][219][219][178][178][174][171][179][176][174][171][219][174][176][174][171][179][176][174][171][179][176][189][173][189][173][195][195][189] [173][177][177][178][195][177][177][195]"
  70. 700 forj=.to3:forx=.to39:m$(x,j)=right$(s$(j),39-x)+left$(s$(j),x):nextx,j
  71. 710 forx=.to39:forj=.to3:l$(x)=l$(x)+m$(x,j)+" ":nextj,x
  72. 720 x=.:poke198,.
  73. 730 poke214,18:print
  74. 740 printl$(x);:forj=.to50:next
  75. 750 geta$:ifa$=""then750
  76. 760 ifa$="[157]"thenx=x+1+(x=39)*40
  77. 770 ifa$=""thenx=x-1+(x=.)*-40
  78. 780 ifa$="x"then810
  79. 790 goto730
  80. 800 rem scrolling diagonal lines
  81. 810 poke53281,5:poke53280,13:print"[147]everybody play football!"
  82. 820 print"press space to run a touchdown!":poke198,.:wait198,1
  83. 830 forx=.to500:print"[205]";:next
  84. 840 rem clear screen lines
  85. 850 poke53281,.:poke53280,.
  86. 860 print"[147]"tab(10)"clearing screen lines"
  87. 870 forx=.to20:poke646,rnd(1)*15+1:printb$;:next
  88. 880 printspc(5)"[146]press c to clear line,x to exit"
  89. 890 geta$:ifa$="c"thenpoke781,(rnd(1)*21)+1:poke783,.:sys59903
  90. 900 ifa$<>"x"then890
  91. 910 rem curtain effect using delete chr$
  92. 920 poke53281,.:poke53280,6:print""
  93. 930 print"[147]":fori=.to22:forx=.to37:print"[194]";:next:print:next
  94. 940 print"press shift to open curtain"
  95. 950 poke214,10:print:printtab(10)"curtain opening":wait653,1
  96. 960 fori=.to39:print"";:forj=.to23:print""chr$(20):nextj,i
  97. 970 rem random mapping
  98. 980 poke53281,6:poke53280,.:print"[147]"chr$(14)tab(14)"[155][205]ap [195]reator"
  99. 990 printtab(7)"[154][208]ress [193] [203]ey [212]o [195]reate [205]ap":poke198,.:wait198,1:print"[147]"
  100. 1000 rem experiment with different seed
  101. 1010 rem values for the random function
  102. 1020 rem to change map layout
  103. 1030 x=rnd(-2.1)
  104. 1040 print"[149]";:a$="[166]":poke214,10:print:printtab(20);:forx=.to999:gosub1100:next
  105. 1050 print"";:a$="[255]":forx=.to100:gosub1100:next
  106. 1060 print"[153]";:a$="[169]":forx=.to300:gosub1100:next
  107. 1070 print"[144]";:a$="[223]":forx=.to300:gosub1100:next
  108. 1080 poke214,22:print:printtab(12)"[204]and of [193]dventure";:goto1130
  109. 1090 rem draw terrain subroutine
  110. 1100 printa$;mid$("[145][157]",rnd(.5)*4+1,1);"[157]";
  111. 1110 ifpeek(214)>22thenprint"[145]";
  112. 1120 return
  113. 1130 poke198,.:wait198,1:printchr$(9)             
  114.